package org.tlipoca.smsteamplayer.lister;

import com.rabbitmq.client.Channel;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.tlipoca.smsteamplayer.service.SteamPlayerService;

import java.util.Map;

@Component
@RequiredArgsConstructor
public class OpenIdListener {

    private final SteamPlayerService service;

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "openid.queue", durable = "true"),
            exchange = @Exchange(name = "openid.topic",type = "topic"),
            key = "openid.routingKey"
    ))
    public void receiver(String steamid){
        service.getSteamPlayerBySteamidService(steamid);
    }

}
